import glfw

def run() -> None:
    if not glfw.init():
        print("初始化GLFW错误！")
        return
    window = glfw.create_window(400, 300, "你好，窗口！", None, None)
    if not window:
        print("创建窗口失败！")
        glfw.terminate()
        return
    glfw.make_context_current(window)

    while not glfw.window_should_close(window):
        glfw.swap_buffers(window)
        glfw.poll_events()

    glfw.destroy_window(window)
    glfw.terminate()

if __name__ == "__main__":
    run()
